home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ccdl150l.zip / IO / FSEEK.C < prev    next >
C/C++ Source or Header  |  1996-06-27  |  468b  |  26 lines

  1. #include <stdio.h>
  2. #include <time.h>
  3. #include <libp.h>
  4.  
  5. int fseek (FILE *stream, long offset, int origin)
  6. {
  7.     if (stream->token != FILTOK)
  8.         return EOF;
  9.     switch (origin) {
  10.         case SEEK_SET:
  11.         case SEEK_END:
  12.         case SEEK_CUR:
  13.             if (fflush(stream)) {
  14.                 stream->flags |= _F_ERR;
  15.                 return EOF;
  16.             }
  17.             if (_ll_seek(stream->fd,offset,origin)) {
  18.                 stream->flags |= _F_ERR;
  19.                 return EOF;
  20.             }
  21.             break;
  22.         default:
  23.             return EOF;
  24.     }
  25.     return 0;
  26. }